package ezy.widget.view;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.EditText;

public class LabelEditText extends EditText {

    private LabelContext lc;


    public LabelEditText(Context context) {
        super(context);
        init(context, null);
    }

    public LabelEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, attrs);
    }

    public LabelEditText(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init(context, attrs);
    }

    private void init(Context context, AttributeSet attrs) {
        lc = new LabelContext(this, attrs);
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        lc.drawableStateChanged();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        lc.onDraw(canvas);
        super.onDraw(canvas);
    }


    public void setLabelText(String value) {
        lc.setLabelText(value);
    }
    public void setSuffixText(String value) {
        lc.setSuffixText(value);
    }
}